package com.example.hellotwo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class MainActivity3 extends AppCompatActivity {
    int score1=0;
    int score2=0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);
    }
    public void aclick(View btn){
        if(btn.getId()==R.id.aa3){
            score1+=3;
        }
        else if(btn.getId()==R.id.aa4){
            score1+=2;
        }
        else if(btn.getId()==R.id.aa5){
            score1+=1;
        }
        else{
            score1=0;
        }
        TextView out=findViewById(R.id.aa2);
        out.setText(String.valueOf(score1));
    }
    public void bclick(View btn){
        if(btn.getId()==R.id.bb3){
            score2+=3;
        }
        else if(btn.getId()==R.id.bb4){
            score2+=2;
        }
        else if(btn.getId()==R.id.bb5){
            score2+=1;
        }
        else{
            score2=0;
        }
        TextView out=findViewById(R.id.bb2);
        out.setText(String.valueOf(score2));
    }
}